<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Sistema Web</title>
    </h:head>
    <h:body>
        Olá #{sessionScope.usuario}, seja Benvindo!
        <h:form id="formTabela">
            
            <br/>
            <h:dataTable border="1" var="data" value="#{usuarioBean.usuarios}" title="Usuários Cadastrados!">
                <h:column>
                    <f:facet name="header">
                        <h:outputLabel value="Nome"/>
                    </f:facet>
                    <h:outputLabel value="#{data.nome}"/>
                </h:column>
                <h:column>
                    <f:facet name="header">
                        <h:outputLabel value="Email"/>
                    </f:facet>
                    <h:outputLabel value="#{data.email}"/>                    
                </h:column>
                <h:column>
                    <f:facet name="header">
                        <h:outputLabel value="Ações"/>
                    </f:facet>
                    <h:commandLink value="Remover" action="#{usuarioBean.removeUsuario}">
                        <f:setPropertyActionListener target="#{usuarioBean.usuario}" value="#{data}"/>
                    </h:commandLink>
                </h:column>
            </h:dataTable>
        </h:form>
    </h:body>
</html>

